import axios, {ResponseData} from 'yuxin-base/src/utils/axios'

// 获取种类
export const listDictId = 'HOUSECONFIG'
export const listEnableDictId = '1ad1a85104d14730821b9ae88553d0b6'



//分页查询房源配置
export const houseConfigGetList = (data: any): Promise<ResponseData> => {
	return axios.request({
		url: '/house/storage/house_config/get_list',
		data,
		method: 'POST'
	})
}

//物业交割单新增
export const houseDeliverySave = (data: any): Promise<ResponseData> => {
	return axios.request({
		url: '/contract/house_delivery/save',
		data,
		method: 'POST'
	})
}
// 获取房间
export const searchByAddress = (data: object): Promise<ResponseData> => {
	return axios.request({
		url: '/basesearch/house/search_by_address',
		data,
		method: 'POST'
	})
}
// 调配物资
export const houseConfigTransfer = (data: object): Promise<ResponseData> => {
	return axios.request({
		url: '/house/storage/house_config/transfer',
		data,
		method: 'post'
	})
}

// 获取物资详情
export const houseConfigDetail = (id: string | number): Promise<ResponseData> => {
	return axios.request({
		url: `/house/storage/house_config/get_by_id?id=${id}`,
		method: 'get'
	})
}
// 获取仓库
export const getWareHouseList = (data: object): Promise<ResponseData> => {
	return axios.request({
		url: '/house/ware_house/list',
		data,
		method: 'POST'
	})
}
// 报废物资
export const houseConfigAbolish = (data: object): Promise<ResponseData> => {
	return axios.request({
		url: '/house/storage/house_config/abolish',
		data,
		method: 'put'
	})
}
// 遗失物资
export const houseConfigMislaid = (data: object): Promise<ResponseData> => {
	return axios.request({
		url: '/house/storage/house_config/mislaid',
		data,
		method: 'put'
	})
}

// 包租合同编辑紧急联系人
export const charterEmergencyContact = (data: object): Promise<ResponseData> => {
	return axios.request({
		url: '/contract/enter_contract/update_emergency',
		data,
		method: 'POST'
	})
}
